function forget(){
    let account=document.getElementById("account").value;
    let password=document.getElementById("password").value;
    let rePassword=document.getElementById("rePassword").value;
    let qqEmail=document.getElementById("qqEmail").value;
    let securityCode=document.getElementById("securityCode").value;
    let filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
    if(account===""||password===""||rePassword===""||qqEmail===""||securityCode===""){
        alert("填写信息不能为空");
    }else{
        if(password===rePassword&&filter.test(qqEmail)){
            document.getElementById("form").submit();//表单提交数据
        }else{
            alert("邮箱格式错误或密码输入不一致");
        }
    }

}
//发送验证码
function getSecurityMode(){
    let account=document.getElementById("account").value;
    let password=document.getElementById("password").value;
    let rePassword=document.getElementById("rePassword").value;
    let qqEmail=document.getElementById("qqEmail").value;
    let securityButton=document.getElementById("securityCodeButton");
    let filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
    if(account===""||password===""||rePassword===""||qqEmail===""){
        alert("填写信息不能为空");
    }else{
        if(password===rePassword&&filter.test(qqEmail)) {
            let xmlHttpRequest = createAjaxFunction();//创建ajax对象
            securityButton.disableb= true;//按钮失效
            securityButton.color="#EAEAEA";//改变颜色，增加视觉效果
            let count = 60;
            countTimes();
            function countTimes() {
                securityButton.innerText = "" + count + "s";
                count--;
                if (count > 0) {
                    setTimeout(countTimes, 1000);
                } else if (count === 0) {
                   securityButton.innerText = "重新发送";
                   securityButton.disabled = false; //重新激活按钮
                     securityButton.color = "#00FFFF";
                }
            }
            xmlHttpRequest.open("GET", "SendEmailServlet?qqEmail=" + qqEmail, true);
            xmlHttpRequest.send();
        }else{
            alert("邮箱格式错误或密码输入不一致");
        }
    }
}
//创建xmlHttpRequest对象
function createAjaxFunction() {
    let xmlHttp;
    //根据不同的浏览器构建ajax对象
    try {
        xmlHttp = new XMLHttpRequest();
    } catch (e) {
        try {
            xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
    }
    return xmlHttp;
}